package com.wefiesta.app;


import com.wefiesta.app.utils.Setting;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;

public class LoadingActivity extends Activity{
	private Context mContext = null;

	private final int LOADING_TIME = 1500;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_loading);
		mContext = this;

		Handler handler = new Handler() {
			@Override
			public void handleMessage(Message msg) {
				super.handleMessage(msg);
				nextActivity();
			}
		};

		handler.sendEmptyMessageDelayed(0, LOADING_TIME);
	}

	private void nextActivity() {

		Setting set = new Setting(mContext);

//		if (set.isLogin()) {
//			startActivity(new Intent(mContext, MainActivity.class));
//		}
//		else {
			startActivity(new Intent(mContext, LoginActivity.class));
//		}

		finish();
	}
}
